package com.google.code.test.stack;

import java.util.EmptyStackException;
import java.util.Stack;

import org.junit.runner.RunWith;

import com.google.code.Bunit;
import com.google.code.Given;
import com.google.code.Then;
import com.google.code.When;

@RunWith(Bunit.class)
public class PushNullScenario {

    @Given("an empty stack")
    private final Stack<String> stack = new Stack<String>();

    @When("pop is called")
    public void pushNull() {

        stack.pop();
    }

    @Then("an exception should be thrown")
    public boolean ensureEmptyStackException(EmptyStackException exception) {

        return exception != null;
    }

    @Then("the stack should still be empty")
    public boolean ensureEmpty() {

        return stack.isEmpty();
    }
}
